import React from 'react'
import { HomeO, CouponO, CartO, UserO } from '@react-vant/icons';
const Home = React.lazy(() => import('../views/home'))
const Cart = React.lazy(() => import('../views/cart'))
const Classify = React.lazy(() => import('../views/classify'))
const My = React.lazy(() => import('../views/my'))
const MainLayout = React.lazy(() => import('../views/mainLayout'))


const Collect = React.lazy(() => import('../views/collect'))
const Login = React.lazy(() => import('../views/login'))
const Detail = React.lazy(() => import('../views/detail'))
const Search = React.lazy(() => import('../views/search'))
const Order = React.lazy(() => import('../views/order'))


// 二级路有
export const mainLayoutChildren_list = [{
  path: '/',
  element: <Home></Home>,
  meta: {
    title: '首页',
    icon: <HomeO  />
  }
},{
  path: '/classify',
  element: <Classify></Classify>,
  meta: {
    title: '分类',
    icon: <CouponO  />
  }
},{
  path: '/cart',
  element: <Cart></Cart>,
  meta: {
    title: '购物车',
    icon: <CartO  />
  }
},{
  path: '/my',
  element: <My></My>,
  meta: {
    title: '我的',
    icon: <UserO  />
  }
}]

// 一级路由
export const routes_list = [{
  path: '/',
  element: <MainLayout></MainLayout>,
  // 二级路有挂载
  children: mainLayoutChildren_list
},{
  path: '/collect',
  element: <Collect></Collect>
},{
  path: '/login',
  element: <Login></Login>
},{
  path: '/detail/:id',
  element: <Detail></Detail>
},{
  path: '/search',
  element: <Search></Search>
},{
  path: '/order',
  element: <Order></Order>
}]